/* 
    生成问卷列表
*/

const Mock = require('mockjs')
const Random = Mock.Random

function getQuestionList(option){
    const {len = 10 , isDelete = false ,isStar} = option
    console.log(option , isDelete , isStar)
    const list = []
    for(let i = 0 ;i< len ;i++){
        list.push({
            _id : Random.id(),
            title:Random.ctitle(),
            isPublished : Random.boolean(),
            isStar : isStar == undefined ?  Random.boolean() : isStar,
            answerCount : Random.natural(50 , 100),// 50 -100随机数
            createAt : Random.datetime(),// 创建时间
            isDelete,
        })
    }
    return list
}

module.exports = getQuestionList